﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp7
{
     public class Host
    {
      
            private string name;
            public Host(string name)
            {
                this.name = name;
            }
        public event EventHandler OnGetup;
        public void Getup()
        {
            Console.WriteLine("日出而作...");
            if (OnGetup != null)
            {
                OnGetup(this, null);
            }
        }
      public void Foster(Cock c1)
        {
            c1.OnSing += new EventHandler(c1_OnSing);
        }  
        private void c1_OnSing(object sender,EventArgs e)
        {
            Console.WriteLine("主人{0}：",name);
            Console.WriteLine("闻鸡起舞！");
            this.Getup();
        }
     }
 }

